import { ImageViewer } from "@/components/common/ImageViewer";

// 商品名称/规格名称 正常显示
export const goodsNameRend: any = ({ row }) => (
  <div class="flex items-center ">
    <ImageViewer radius="8px" src={row.specImageJson || row.imageJson} />
    <div class="ml-2">
      {row.specName ? row.goodsName + " (" + row.specName + ")" : row.goodsName}
    </div>
  </div>
);

// 商品名称/规格名称 超出显示... (表格属性 showOverflowTooltip 为true使用)
export const goodsNameOverRend: any = ({ row }) => (
  <div class="flex items-center ">
    <ImageViewer radius="8px" src={row.specImageJson || row.imageJson} />
    <div class="flex-1 ml-2 text-cut">
      {row.specName ? row.goodsName + " (" + row.specName + ")" : row.goodsName}
    </div>
  </div>
);

// 商品编码/规格编码 显示
export const goodsCodeRend: any = ({ row }) => (
  <div>
    <div>{row.goodsCode}</div>
    <div>{row.specCode}</div>
  </div>
);
